![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
The newt male class. More...
#include <Newt.h>
Public Member Functions | |
Newt_Male (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib) | |
Newt_Male constructor. More... | |
~Newt_Male () | |
Newt_Male destructor. More... | |
virtual void | ReInit (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual void | BeginStep (void) |
Newt_Male BeingStep code. Called once per timestep, this only records pond presence. More... | |
virtual void | Step (void) |
Newt_Male Step code. This is called continuously until all animals report that they are 'DONE'. More... | |
virtual TTypeOfNewtState | st_Develop (void) |
Male development state. More... | |
void | InternalPesticideHandlingAndResponse () |
For handlng of class-specific pesticide effects. More... | |
![]() | |
Newt_Adult (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib) | |
Newt_Adult constructor. More... | |
~Newt_Adult () | |
Newt_Male destructor. More... | |
virtual void | Init (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age) |
Initialise object. More... | |
int | GetInPond () |
Returns the current pond status (-1 if not in pond else the pond ref is returned) More... | |
void | SetInPond () |
Forces setting the in pond status to the first pond ref - used only on start-up. More... | |
![]() | |
Newt_Juvenile (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib) | |
Newt_Juvenile constructor. More... | |
~Newt_Juvenile () | |
Newt_Juvenile destructor. More... | |
double | GetWeight () |
Get method for m_weight. More... | |
void | SetWeight (double a_weight) |
Set method for m_weight. More... | |
void | InternalPesticideHandlingAndResponse () |
For handlng of class-specific pesticide effects. More... | |
![]() | |
Newt_Base (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib) | |
Newt constructor. More... | |
void | Init (vector< unsigned > a_pond, Newt_Population_Manager *a_NPM, bool a_reproinhib) |
Intitialise object. More... | |
void | ReInit (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib) |
ReInit for object pool. More... | |
~Newt_Base () | |
Newt destructor. More... | |
virtual int | WhatState () |
Returns the state number for display purposes. More... | |
TTypeOfNewtState | st_Develop (void) |
Behavioural state development - does nothing in the base class. More... | |
TTypeOfNewtState | st_Movement (void) |
Behavioural state movement - does nothing in the base class. More... | |
void | st_Dying (void) |
Behavioural state dying. More... | |
virtual void | EndStep (void) |
The EndStep is the third 'part' of the timestep that an animal can behave in. It is called once per timestep. More... | |
unsigned | GetAge () |
A typical interface function - this one returns the Age as an unsigned integer. More... | |
void | SetAge (unsigned a_age) |
A typical interface function - this one sets the Age as an unsigned integer. More... | |
unsigned | GetHomePond () |
A typical interface function - this one returns the home pond reference as an unsigned integer. More... | |
void | SetHomePond (unsigned a_pond) |
A typical interface function - this one sets the home pond reference as an unsigned integer. More... | |
void | InternalPesticideHandlingAndResponse (double) |
For handlng of class-specific pesticide effects. More... | |
![]() | |
unsigned | SupplyFarmOwnerRef () |
AnimalPosition | SupplyPosition () |
APoint | SupplyPoint () |
int | SupplyPolygonRef () |
int | Supply_m_Location_x () |
int | Supply_m_Location_y () |
virtual void | KillThis () |
virtual void | CopyMyself () |
void | SetX (int a_x) |
void | SetY (int a_y) |
TAnimal (int x, int y, Landscape *L) | |
virtual void | ReinitialiseObject (int x, int y, Landscape *L) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual void | Dying () |
void | CheckManagement (void) |
void | CheckManagementXY (int x, int y) |
virtual bool | OnFarmEvent (FarmToDo) |
![]() | |
int | GetCurrentStateNo () |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
virtual void | ReinitialiseObject () |
Used to re-use an object - must be implemented in descendent classes. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject () |
The destructor for TALMaSSObject. More... | |
void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
Protected Member Functions | |
virtual TTypeOfNewtState | st_EvaluateHabitat (void) |
Adult evaluate habitat behaviour. More... | |
![]() | |
void | CalcMovementVector (void) |
Calculates the direction needed to move in to get to the target pond. More... | |
bool | AgeMortTest (void) |
Ages the adult and applies a daily mortality probability. More... | |
virtual TTypeOfNewtState | st_Disperse (void) |
Adult development state. More... | |
virtual TTypeOfNewtState | st_Overwinter (void) |
Adult dormant state. More... | |
virtual TTypeOfNewtState | st_Migrate (void) |
Adult migration to pond state. More... | |
![]() | |
virtual TTypeOfNewtState | st_NextStage (void) |
Juvenile maturation. More... | |
void | MoveTo (TTypeDirectedWalk a_directedness, int a_stepsize, int a_steps) |
Top level control of newt movement. More... | |
void | NewtDoWalking (int &a_vector, int a_stepsize, int a_steps, int &vx, int &vy) |
This method moves the newt through the landscape. More... | |
void | NewtDoWalkingCorrect (int &a_vector, int a_stepsize, int a_steps, int &vx, int &vy) |
This method moves the newt through the landscape using wrap around corrects. More... | |
int | NewtMoveQuality (int a_x, int a_y, TTypesOfLandscapeElement &a_tole) |
Tests the habitat quality for a square to move to. More... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Additional Inherited Members | |
![]() | |
static double | m_AdultPPPThreshold = cfg_NewtAdultPPPToxTrigger.value() |
The threshold for effect of PPP on adults. More... | |
static double | m_AdultPPPElimRate = cfg_NewtAdultPPPToxEliminationRate.value() |
The daily proportion of PPP body burden that is not eliminated for adults. More... | |
static double | m_AdultPPPEffectProbability = cfg_NewtAdultPPPEffectProbability.value() |
The daily probability of effect if above m_AdultPPPThreshold for adults. More... | |
static unsigned | m_AdultLifespan = cfg_NewtAdultLifespan.value() |
static int | m_newtadultwalkspeed = cfg_NewtWalkSpeed.value()/10 |
The max walking speed of a newt. More... | |
![]() | |
static double | m_JuvenilePPPThreshold_Min = 0 |
The minimum threshold for effect of PPP on juveniles. More... | |
static double | m_JuvenilePPPThreshold_EnvConc = cfg_NewtJuvenilePPPToxTrigger_EnvConc.value() |
The environmental concentration threshold for effect of PPP on juveniles. More... | |
static double | m_JuvenilePPPThreshold_Overspray = cfg_NewtJuvenilePPPToxTrigger_Overspray.value() |
The overspray threshold for effect of PPP on juveniles. More... | |
static double | m_JuvenilePPPElimRate = cfg_NewtJuvenilePPPToxEliminationRate.value() |
The daily proportion of PPP body burden that is not eliminated for juveniles. More... | |
static double | m_JuvenilePPPEffectProbability_EnvConc = cfg_NewtJuvenilePPPEffectProbability_EnvConc.value() |
The daily probability of effect if above m_JuvenilePPPThreshold for juveniles for environmental concentration. More... | |
static double | m_JuvenilePPPEffectProbability_Overspray = cfg_NewtJuvenilePPPEffectProbability_Overspray.value() |
The daily probability of effect if above m_JuvenilePPPThreshold for juveniles for overspray. More... | |
static double | m_JuvenileDailyWeightGain = cfg_NewtJuvenileDailyLengthGain.value() |
Used in determining daily growth. More... | |
static int | m_SimW = 0 |
The width of the simulation map, stored for fast access. More... | |
static int | m_SimH = 0 |
The height of the simulation map, stored for fast access. More... | |
static double | m_roadmortalityprob = cfg_NewtRoadMortalityProb.value() |
The probability of death when crossing a road. More... | |
static int | m_newtwalkspeed = cfg_NewtWalkSpeed.value() |
The max walking speed of a newt. More... | |
static int | m_newtwalkstepsize = cfg_NewtWalkStepsize.value() |
The size of a step when evaluating habitat during walking. More... | |
static double | m_goodhabitatdispersalprob = cfg_newtgoodhabitatdispersalprob.value() |
Probability of dispersal in good habitat. More... | |
static double | m_poorhabitatdispersalprob = cfg_newtpoorhabitatdispersalprob.value() |
Probability of dispersal in poor habitat. More... | |
static double | m_NewtDormancyTemperature = cfg_newtdormancytemp.value() |
Temperature in degrees that the newts become dormant. More... | |
static double | m_NewtDormancyHumidity = cfg_newtdormancyhumidity.value() |
Temperature in degrees that the newts become dormant. More... | |
![]() | |
static double | m_EggDevelopmentDDTotal = cfg_NewtEggDevelTotal.value() |
static double | m_EggDevelopmentDDParameter = cfg_NewtEggDevelDDParameter.value() |
static double | m_JuvenileDevelopmentSize = cfg_NewtJuvenileDevelSize.value() |
static double | m_EggMortalityChance = cfg_NewtEggMortalityChance.value() |
static double | m_JuvenileMortalityChance = 0.0 |
static double | m_AdultMortalityChance = 0.0 |
static bool | m_test_pesticide_egg = cfg_Newt_Test_Pesticide_Egg.value() |
Flags to record whether we are in pesticide testing mode. More... | |
static bool | m_test_pesticide_larva = cfg_Newt_Test_Pesticide_Larva.value() |
static bool | m_test_pesticide_terrestrial = cfg_Newt_Test_Pesticide_Terrestrial.value() |
![]() | |
int | m_targetpondx |
x-coord of a target pond More... | |
int | m_targetpondy |
y-coord of a target pond More... | |
![]() | |
int | m_InPond |
The polyrefindex for the pond the newt is in, or -1 if not in a pond. More... | |
double | m_weight |
unsigned | m_OurVector |
The last direction we moved in. More... | |
TTypesOfLandscapeElement | m_CurrentHabitat |
The current habitat type the newt is in. More... | |
bool | m_forcedisperse |
A flag to force dispersal from the breeding ponds. More... | |
![]() | |
TTypeOfNewtState | m_CurrentNewtState |
Variable to record current behavioural state. More... | |
unsigned | m_Age |
vector< unsigned > | m_pondlist |
Newt_Population_Manager * | m_OurPopulationManager |
This is a time saving pointer to the correct population manager object. More... | |
double | m_body_burden |
The current PPP body burden for use in pesticide testing mode. More... | |
bool | m_reproductiveinhibition |
A flag to indicate environmentally induced reproductive inhibition (value is inherited by descendent classes) More... | |
![]() | |
int | m_Location_x |
int | m_Location_y |
Landscape * | m_OurLandscape |
![]() | |
int | m_CurrentStateNo |
The basic state number for all objects - '-1' indicates death. More... | |
bool | m_StepDone |
Indicates whether the iterative step code is done for this timestep. More... | |
The newt male class.
Newt_Male::Newt_Male | ( | int | a_x, |
int | a_y, | ||
vector< unsigned > | a_pond, | ||
Landscape * | a_L, | ||
Newt_Population_Manager * | a_NPM, | ||
unsigned | a_age, | ||
bool | a_reproinhib | ||
) |
Newt_Male constructor.
Newt_Male adds no new attributes to Newt_Adult.
The only special behaviour defined here is the Step code.
Newt_Male::~Newt_Male | ( | void | ) |
Newt_Male destructor.
|
virtual |
Newt_Male BeingStep code. Called once per timestep, this only records pond presence.
This is a speed improvement. The newt records that there is a male in the pond to prevent the long search time if a female is looking. This is done by true/false because currently there is no need to identify a particular male. This must be done in the begin step to prevent problems with the timing for females, and resetting by DoDevelopment for pond flags.
Reimplemented from Newt_Base.
References Newt_Juvenile::m_InPond, TAnimal::m_OurLandscape, and Landscape::SetMaleNewtPresent().
void Newt_Male::InternalPesticideHandlingAndResponse | ( | ) |
For handlng of class-specific pesticide effects.
This method is re-implemented from Newt_Base for any class which has pesticide response behaviour. If the body burden exceeds the trigger then an effect is tested for and implemented depending on the pesticide type.
References g_msg, g_rand_uni, TAnimal::KillThis(), Newt_Adult::m_AdultPPPEffectProbability, Newt_Adult::m_AdultPPPThreshold, Newt_Base::m_body_burden, Newt_Base::m_CurrentNewtState, TAnimal::m_OurLandscape, Landscape::SupplyPesticideType(), toNewts_Die, ttop_AcuteEffects, ttop_MultipleEffects, ttop_NoPesticide, ttop_ReproductiveEffects, and MapErrorMsg::Warn().
Referenced by st_Develop().
|
virtual |
Used to re-use an object - must be implemented in descendent classes.
Reimplemented from Newt_Adult.
References Newt_Adult::ReInit().
Referenced by Newt_Population_Manager::CreateObjects().
|
virtual |
Male development state.
Adds pesticide handling to the Adult version of st_Develop If there is the need to test for pesticide effects then the body-burden is adjusted for yesterdays elimination, then pesticide at this location is determined and any intake stored. InternalPesticideHandlingAndResponse is called, and if the body-burden is greater than the threshold for effects then the impacts are determined.
Reimplemented from Newt_Adult.
References InternalPesticideHandlingAndResponse(), Newt_Adult::m_AdultPPPElimRate, Newt_Base::m_body_burden, Newt_Base::m_CurrentNewtState, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Newt_Base::m_test_pesticide_terrestrial, ppp_1, Newt_Adult::st_Develop(), Landscape::SupplyPesticide(), and toNewts_Die.
Referenced by Step().
|
protectedvirtual |
Adult evaluate habitat behaviour.
Reimplemented from Newt_Adult.
References Newt_Adult::st_EvaluateHabitat().
Referenced by Step().
|
virtual |
Newt_Male Step code. This is called continuously until all animals report that they are 'DONE'.
Reimplemented from Newt_Juvenile.
References Newt_Base::m_CurrentNewtState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_Develop(), Newt_Adult::st_Disperse(), Newt_Base::st_Dying(), st_EvaluateHabitat(), Newt_Adult::st_Migrate(), Newt_Adult::st_Overwinter(), toNewts_Breed, toNewts_Develop, toNewts_Die, toNewts_Dispersal, toNewts_EvaluateLocation, toNewts_InitialState, toNewts_Migrate, toNewts_Overwinter, toNewts_Remove, and Landscape::Warn().